// 首页数据模块
export default {
    namespaced: true,
    // 记录数据
    state: {
        artists: [], // 歌手数据
        songs: [], // 歌曲数据
        playlists: [], // 歌单数据
        albums: [], // 专辑数据
        programs: [], // 节目数据
    },
    // 修改数据
    mutations: {
        setArtists(state, value) {
            state.artists = value;
        },
        setSongs(state, value) {
            state.songs = value;
        },
        setPlaylists(state, value) {
            state.playlists = value;
        },
        setAlbums(state, value) {
            state.albums = value;
        },
        setPrograms(state, value) {
            state.programs = value;
        },
    },
    // 提交要修改的数据
    actions: {
        setArtistsAsync(content, value) {
            content.commit('setArtists', value)
        },
        setSongsAsync(content, value) {
            content.commit('setSongs', value)
        },
        setPlaylistsAsync(content, value) {
            content.commit('setPlaylists', value)
        },
        setAlbumsAsync(content, value) {
            content.commit('setAlbums', value)
        },
        setProgramsAsync(content, value) {
            content.commit('setPrograms', value)
        },
    }
}